<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateXkUser extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('xk_user', function (Blueprint $table) {
            $table->id();

            $table->unsignedBigInteger("wid")->comment("销氪用户wid")->default(0);
            $table->string("zone")->comment("zone")->default("");
            $table->string("headImage")->comment("headImage")->default("");
            $table->unsignedTinyInteger("isSeat")->comment("isSeat")->default(0);
            $table->string("telephone")->comment("telephone")->default("");
            $table->string("userName")->comment("userName")->default("");
            $table->unsignedTinyInteger("userType")->comment("userType")->default(0);
            $table->unsignedBigInteger("pid")->comment("pid")->default(0);
            $table->unsignedTinyInteger("isMerchants")->comment("是否为招商人员")->default(0);
            $table->tinyInteger('isAlive')->default(0)->comment('isAlive 0 否 1是');
            $table->tinyInteger('isDel')->default(0)->comment('是否删除 0 否 1是');


            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');

            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '销氪用户表';
            $table->index(["telephone"], "idx_telephone");
            $table->index(["wid"], "idx_wid");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('xk_user');
    }
}
